package com.company.emallbackend.controller;

import com.company.emallbackend.common.Result;
import com.company.emallbackend.entity.Comment;
import com.company.emallbackend.service.ICommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
* <p>
*  前端控制器
* </p>
*
* @author hanlijian
* @since 2023-01-13
*/
@RestController
@RequestMapping("/comment")
@Api(tags = "评论管理")
public class CommentController {

    @Resource
    private ICommentService commentService;

    /**
     * 评论商品
     * @param comment
     * @return
     */
    @PostMapping("commentProduct")
    @ApiOperation("评论商品")
    public Result commentProduct(@RequestBody Comment comment){
        commentService.commentProduct(comment);
        return Result.success("评论成功");
    }
    
}
